<template>
    <div class="box">
        <h2>
            这是A组件,{{ count.num }}
            <el-button type="primary" size="default" @click="count.num++">
                数字+
            </el-button>  
            <h3>总数:{{cart.total.totalNum}}  总价:{{cart.total.totalPrice}}</h3>
            <div class="cart-list" v-for="item in cart.cartList">
                名称:{{item.name}} 价格:{{item.price}} 数量:{{item.n}}
            </div>       
        </h2>
    </div>
</template>

<script setup>
import { useCount } from '../../store/count';
import { useCart } from '../../store/cart';
const count = useCount()
const cart = useCart()
</script>

<style scoped>
.box{
    height: 400px;
    width: 40%;
    border: 1px solid #333;
}
.cart-list{
    font-size: 18px
}
</style>